using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using T2.WebSecurity.Data.Controllers.Interfaces;
using T2.WebSecurity.Data.Entities.Interfaces;
using T2.WebSecurity.Business.Entities.Interfaces;
using T2.WebSecurity.Business.Entities;
using T2.WebSecurity.Data.Controllers;
using T2.WebSecurity.Business.Builders.Interface;
using T2.WebSecurity.Business.Translators;
using T2.WebSecurity.Business.Entities.Search.Interfaces;
using T2.WebSecurity.Data.Entities.Search.Interfaces;


//--Change Management Control - UserProfileData Builder  --**********************
//--Created By: trooks
//--Description: UserProfileData Builder Class
//--Created Date: 03/07/2013 10:49:04
//--*************************************************************

namespace T2.WebSecurity.Business.Builders
{
	public partial class UserProfileData_Builder : IUserProfileData_builder 
	{
		
	public List<IUserProfileData_biz> BuildParts (IUserProfileData_biz _param)
	{
			IUserProfileData_biz temp = new UserProfileData_biz();
			IUserProfileDataController cont = new UserProfileDataController();
			List<IUserProfileData_biz> tempList = new List<IUserProfileData_biz>();
			List<IUserProfileData> tempData = new List<IUserProfileData>();
			switch (_param.Action)
			{
				case "GetOne":
				temp = UserProfileDataTranslator.TranslateFromDataLayer(cont.UserProfileData_GetOne(UserProfileDataTranslator.TranslateToDataLayer(_param)));
				tempList.Add(temp);
				return tempList;

				case "GetAll":
				tempData = cont.UserProfileData_GetAll(UserProfileDataTranslator.TranslateToDataLayer(_param));
				tempList = tempData.Select(p => UserProfileDataTranslator.TranslateFromDataLayer(p)).Cast<IUserProfileData_biz>().ToList();
				return tempList;

				case "UserProfile_UserProfileData_ByParent":
				tempData = cont.UserProfile_UserProfileData_ByParent(UserProfileDataTranslator.TranslateToDataLayer(_param));
				tempList = tempData.Select(p => UserProfileDataTranslator.TranslateFromDataLayer(p)).Cast<IUserProfileData_biz>().ToList();
				return tempList;

			}
			return tempList;
}
	public List<IUserProfileData_biz> BuildParts (IUserProfileDataSearch_biz _param)
	{
			IUserProfileData_biz temp = new UserProfileData_biz();
			IUserProfileDataController cont = new UserProfileDataController();
			List<IUserProfileData_biz> tempList = new List<IUserProfileData_biz>();
			List<IUserProfileData> tempData = new List<IUserProfileData>();
			tempData = cont.UserProfileData_Search(UserProfileDataTranslator.TranslateSearchToDataLayer(_param));
			tempList = tempData.Select(p => UserProfileDataTranslator.TranslateFromDataLayer(p)).Cast<IUserProfileData_biz>().ToList();
			return tempList;

	}
		
	}
}
